export const baseUrl='http://localhost:8888'

export const menuList = [
  { id: 1, name: '用户管理', path: '/pages/userIndex/userIndex' },
  { id: 2, name: '管理员管理', path: '/pages/adminIndex/adminIndex' },
  { id: 3, name: '轮播图管理', path: '/pages/swipperIndex/swipperIndex' },
  { id: 3, name: '讨论管理', path: '/pages/postIndex/postIndex' },
  { id: 3, name: '书籍管理', path: '/pages/bookIndex/bookIndex' }
];

export const handleMenuItemClick = (path) => {
	uni.navigateTo({
		url:path
	})
};

export function checkLogin(){
		let authorization=localStorage.getItem('Authorization')
		if(authorization==null || authorization==''){
			uni.navigateTo({
				url:'/pages/login/login'
			})
		}
		return authorization;
}

export function  handleRequestCode(data){
	if(data.code==401){
		uni.showToast({
			icon:'error',
			title:'请先登录'
		})
	}
	if(data.code==400){
		uni.showToast({
			icon:'error',
			title:data.msg
		})
	}
}